<?php
/**
 * Created by PhpStorm.
 * User: Lin
 * Date: 2018/1/18
 * Time: 12:56
 */

namespace app\common\model;


use think\Db;

class News
{
    public function getAllUpNewsList(){
        $sql = 'select nid,title,ntime from news where status = 1 ORDER BY ntime desc';
        return Db::query($sql);
    }

    public function getAllNewsList(){
        $sql = 'select news.*, user.username from news left join user on user.uid = news.admin_id order by ntime desc';
        return Db::query($sql);

    }
}